using ASP;
using System;
using System.Globalization;
using System.Threading;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using Resources;
using AjaxControlToolkit;
using IPMS.AccessAuth;
using IPMS.Sort;

public partial class Users : Page, IRequiresSessionState
{
    protected void GridViewListAllUsers_SelectedIndexChanged(object sender, EventArgs e)
    {
        string selectedUserId = this.GridViewListAllUsers.DataKeys[this.GridViewListAllUsers.SelectedIndex].Value.ToString();
        this.ODSUserPages.SelectParameters.Clear();
        this.ODSUserPages.SelectParameters.Add("UserId", selectedUserId);
        this.GridViewPages.DataBind();
    }

    protected override void InitializeCulture()
    {
        string sCulture = this.Session["Culture"].ToString();
        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(sCulture);
        Thread.CurrentThread.CurrentUICulture = new CultureInfo(sCulture);
        base.InitializeCulture();
    }

    private void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Auth canView = new Auth(this.Session["UserId"].ToString(), string.Empty, "WebPageMaintenance");
            if (!canView.CanView())
            {
                base.Response.Redirect("ErrorPage/NotAllowed.aspx", false);
                return;
            }
        }
        catch (Exception ex)
        {
            base.Response.Redirect("Login.aspx");
        }
        if (!IsPostBack)
        {
            ((Label)this.Master.FindControl("lblMstTitle")).Text = " | " + ISitemap.Settings + " | " + ISitemap.SecurityLevels + " | " + ISitemap.WebUsers.ToString();

        }
    }
}
